home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 16 / AMIGAplus Sonderheft 16 (1998)(ICP)(DE)[!].iso / pd / anwendungen / xpk_source / libraries / none / xpknone.c < prev   
C/C++ Source or Header  |  1998-08-27  |  2KB  |  71 lines

  1. /*
  2.  * This library is mainly intended to demonstrate how to program a
  3.  * sub library
  4.  */
  5.  
  6. #include <xpk/xpksub.h>
  7. #include <proto/exec.h>
  8. #include "xpkLibNONE.h"
  9. #include "SDI_compiler.h"
  10.  
  11. STATIC const struct XpkMode NONEMode = {
  12.   NULL,       /* Next mode */
  13.   100,        /* Handles up to */
  14.   XPKMF_A3000SPEED, /* Flags */
  15.   0,          /* Packing memory */
  16.   0,          /* Unpacking memory */
  17.   1918,       /* Packing speed */
  18.   2477,       /* Unpacking speed */
  19.   0,          /* Compression ratio */
  20.   0,          /* Reserved */
  21.   "normal",   /* Description */
  22. };
  23.  
  24. STATIC const struct XpkInfo NONEInfo = {
  25.   1,               /* info version */
  26.   VERSION,         /* lib  version */
  27.   0,               /* master vers  */
  28.   0,               /* ModesVersion */
  29.   "NONE"  ,        /* short name   */
  30.   "NoPacker",      /* long name    */
  31.   "A dummy library that does no compression", /* Description  */
  32.   0x4E4F4E45,      /* 4 letter ID  */
  33.   XPKIF_PK_CHUNK | /* flags        */
  34.   XPKIF_UP_CHUNK,
  35.   32768,           /* max in chunk */
  36.   20,              /* min in chunk */
  37.   32768,           /* def in chunk */
  38.   "Writing",       /* pk message   */
  39.   "Reading",       /* up message   */
  40.   "Wrote",         /* pk past msg  */
  41.   "Read",          /* up past msg  */
  42.   50,              /* DefMode      */
  43.   0,               /* Pad          */
  44.   (struct XpkMode *)&NONEMode, /* ModeDesc     */
  45.   {0,}             /* reserved     */
  46. };
  47.  
  48. /* returns an info structure about our packer */
  49.  
  50. ASM(const struct XpkInfo *) LIBXpksPackerInfo(void)
  51. {
  52.   return &NONEInfo;
  53. }
  54.  
  55. /* compresssion and decompression stuff */
  56.  
  57. ASM(LONG) LIBXpksPackChunk(REG(a0, struct XpkSubParams *xpar),
  58. REG(a6, struct XpkSubBase *XpkSubBase))
  59. {
  60.   return XPKERR_EXPANSION;
  61. }
  62.  
  63. #define SysBase XpkSubBase->xsb_SysBase
  64.  
  65. ASM(LONG) LIBXpksUnpackChunk(REG(a0, struct XpkSubParams *xpar),
  66. REG(a6, struct XpkSubBase *XpkSubBase))
  67. {
  68.   CopyMem(xpar->xsp_InBuf,xpar->xsp_OutBuf,xpar->xsp_OutLen=xpar->xsp_InLen);
  69.   return 0;
  70. }
  71.